//
// Created by 吴锐 on 2022/3/1.
//

#include "iostream"
#include "string"

using namespace std;

void test01(){
    string s1 = "hello";

    cout << "s1 = " << s1 << endl;

    for(int i = 0 ; i < s1.size() ; i++){
        cout << s1[i] << " ";
    }
    cout << endl;

    for(int i = 0 ; i < s1.size() ; i++){
        cout << s1.at(i) << " ";
    }
    cout << endl;

    s1[0] = 'x';
    cout << "s1 = " << s1 << endl;

    s1.at(1) = 'x';
    cout << "s1 = " << s1 << endl;
}

int main(){
    test01();
    return 0;
}